1. Field
One embodiment of the invention relates to a computer program for causing a plurality of processors to perform parallel processing, a multiple processor system, and a grouping method for programming.
2. Description of the Related Art
In order to realize high speed computer processing, multi-thread processing is used, in which a plurality of tasks are processed in parallel. In a parallel processing program incorporating multi-thread processing, a plurality of threads are created and the threads have to take into account simultaneous processing by other threads. For example, to maintain the sequence of operations properly, an additional process to ensure synchronization has to be included in various parts of the program. This makes debugging of the program difficult, etc., thus increasing maintenance costs.
As an example of such a parallel processing programming, a multi-thread execution method has been proposed as described in Patent Document 1 (Jpn. Pat. Appln. KOKAI Publication No. 2005-258920 (Paragraph [0014], FIG. 7). This document discloses a method in which when a plurality of interdependent threads (in which thread 1 can be executed only after thread 2) are created, parallel processing is performed based on the result of the execution of these threads and their interdependence.
In order to perform processing while programs to be processed in parallel maintain an appropriate execution sequence, fixed dependency relationships among the programs and/or the threads have to be determined in advance. At the same time, it is also preferable to have a mechanism for dynamically adjusting the execution load of each program according to the point in its execution that the program has reached at that moment.
One of the forms for parallel processing includes two elements: runtime processing having a scheduler which assigns a plurality of process units to an execution unit (CPU); and a process unit to be processed by each execution unit. In the context of parallel processing, the size of a process unit is called granularity. Refining the granularity increases opportunities for parallel processing, thereby enhancing the parallel performance. However, if the granularity in parallel processing is too fine, it increases the frequency of scheduler operations and hence overheads. The performance thus obtained is unsatisfactory.
When the number of execution units (CPUs) is sufficient, even if the runtime overhead is increased, an improvement in performance can be sufficient by enhancing the degree of parallelism to such a level that almost all execution units will be used. When the degree of parallelism is sufficient in relation to the number of execution units, the efficiency of execution can be improved by restraining the parallelism, thereby reducing the runtime overhead.
Furthermore, in an environment in which the number of processors may be two-digits or more and in the case where memory hierarchy is multi-layer and the data communication overhead between processors is uneven, process units are assigned to processors so that any process unit involved in data transfer is assigned to the nearest possible processor. Thus the memory band width of shared memory access can be reduced. However, in order that a programmer may explicitly specify the method for assigning process units to processors, a complex task such as program rewriting is required.
A program display method has been developed, by which a program for executing such a plurality of processes in parallel is formed visually and hierarchically using graphics (e.g., Patent Document 2 (Jpn. Pat. Appln. KOKAI Publication No. 6-332689; paragraph [0056], FIG. 16)). This example uses a program development environment as a function realized as a process executed by a parallel computing machine. The program development environment includes, as a program specific to its own process, an editor, debugger and parallelism evaluation program, as described above. Also, the program development environment has a program graphical user interface (GUI) for graphically displaying the content of a source program, and for transmitting commands from a mouse or keyboard to the editor, debugger, and parallelism evaluation program. The program GUI plays the role of controlling the whole program development environment, such as transmitting commands input by a mouse or keyboard to the editor, debugger, parallelism evaluation program, etc.
The program display method as described in Patent Document 2 accepts edition of the hierarchical structure with a plurality of process units composing a program. It does not accept, however, edition involving a change in granularity for parallel execution.
In this manner, in the conventional program display method, it is impossible to edit a program for adjusting the granularity in parallel processing, which is the size for a unit of parallel processing.